<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="app">
        <div class="redColor">红色字</div>
        <!-- <div class="blueColor">蓝色字</div> -->
        <div v-bind:class="colorClass">展示不同颜色</div>
        <div v-bind:class="num > 10 ? 'redColor' : 'blueColor' ">展示不同颜色</div>
        <div v-bind:class="['word', num > 10 ? 'redColor' : 'blueColor'] ">展示不同颜色</div>
    </div>
    <script>
        new Vue({
            el: '#app',
            data: {
                // colorClass: 'redColor'
                num: 0, // 数字大于10红色，其余蓝色
            }
        })
    </script>


    <style>
        .word{
            font-size: 20px;
        }
        .redColor{
            color: red;
        }
        .blueColor{
            color: blue;
        }
    </style>
</body>
</html>